package com.patMall.service.impl;

import com.patMall.entity.Carousel;
import com.patMall.mapper.CarouselMapper;
import com.patMall.service.CarouselService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author 750909637@qq.com
 * @PackageName patMall
 * @Package com.patMall.service.impl
 * @Date 2024/1/10 11:48
 * @Version 1.0
 */
@Service
public class CarouselServiceImpl implements CarouselService {
    @Resource
    private CarouselMapper carouselMapper;
    @Override
    public int addCarousel(Carousel carousel) {
        return carouselMapper.insert(carousel);
    }

    @Override
    public int updateCarousel(Carousel carousel) {
        return carouselMapper.update(carousel);
    }

    @Override
    public int removeCarousel(Integer carouselId) {
        return carouselMapper.delete(carouselId);
    }

    @Override
    public List<Carousel> getAllCarousel() {
        return carouselMapper.getAllCarousel();
    }
}
